$viewsthread=thread_find(array('fid'=>$fid),array('views'=>-1),1,8);
$randthread=thread_find(array(),array('views'=>-1),1,8);

$nextthread=db_find_one('thread', array('tid'=>$tid+1));
$next_img=get_first_img_by_tid($tid+1);
if(empty($next_img)) $next_img="http://menhu.yangqq.com/skin/menhu/images/pic01.jpg";

$lastthread=db_find_one('thread', array('tid'=>$tid-1));
$last_img=get_first_img_by_tid($tid-1);
if(empty($last_img)) $last_img="http://menhu.yangqq.com/skin/menhu/images/pic02.jpg";